#include <ObjectInspectorItem.h>

ObjectInspectorItem::ObjectInspectorItem(const QString &text) : QStandardItem(text)
{
    //m_eObject;
    //m_eObject->setObjItem(this);
    setEditable(false);

    m_hasExpanded = false;
}

ObjectInspectorItem::~ObjectInspectorItem()
{

}
void ObjectInspectorItem::setObjectPtr(QSharedPointer<EObject> osgObjectQt)
{
    m_eObject = osgObjectQt;
}

QSharedPointer<EObject> ObjectInspectorItem::getObjectPtr()
{
    return m_eObject;
}

void ObjectInspectorItem::setHasExpanded(bool boolValue)
{
    m_hasExpanded = boolValue;
}

bool ObjectInspectorItem::getHasExpanded()
{
    return m_hasExpanded;
}

void ObjectInspectorItem::removeFromParent()
{
    QStandardItem* parentItem = this->parent();
    this->parent()->removeRow(this->row());
}

void ObjectInspectorItem::changeParent(QStandardItem *parentItem)
{
    if(parentItem == NULL)return;
    this->parent()->takeRow(this->row());
    parentItem->appendRow(this);
}

void ObjectInspectorItem::takeFromParent()
{
    this->parent()->takeRow(this->row());
}
